package View;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;

/** 
 * @author  作者 E-mail: 
 * @date 创建时间：2015-6-2 下午4:02:54 
 * @version 1.0 
 * @parameter  
 * @since  
 * @return  
 */
public class CustomViewPager extends ViewPager {  
	  
    private boolean isCanScroll = true;  
  
    public void EnabledScroll(){
    	this.isCanScroll=true;
    }
    
    public void DisableScroll(){
    	this.isCanScroll=false;
    }
    
    
    public CustomViewPager(Context context) {  
        super(context);  
    }  
  
    public CustomViewPager(Context context, AttributeSet attrs) {  
        super(context, attrs);  
    }  
  
    public void setScanScroll(boolean isCanScroll){  
        this.isCanScroll = isCanScroll;  
    }  
  
  
    @Override  
    public void scrollTo(int x, int y){  
        if (isCanScroll){  
            super.scrollTo(x, y);  
        }  
    }
}